package com.qf.controller;

import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
@ControllerAdvice //控制器增强
public class ExceptionController {

    //ExceptionHandler 捕捉什么类型的异常 UnauthorizedException 没权限异常
    @ExceptionHandler(value = UnauthorizedException.class)
    public String unauth(){
        return "unauth";
    }
    @ExceptionHandler(value = IncorrectCredentialsException.class)
    public String passwordError(){
        return "passwordError";
    }

}
